libxenguest: Add another range check to dom restore.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 21 Jun 2007 11:10:01 +0000 (12:10 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 21 Jun 2007 11:10:01 +0000 (12:10 +0100)
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/libxc/xc_domain_restore.c

index 3193ce191c7f22d484585a6c6a7cae89943564ce..e7ff90dcfd73553a5f40622df5d087b5a7fc5b5e 100644 (file)
@@ -465,7 +465,7 @@ int xc_domain_restore(int xc_handle, int io_fd, uint32_t dom,
         if ( j == 0 )
             break;  /* our work here is done */
 
-        if ( j > MAX_BATCH_SIZE )
+        if ( (j > MAX_BATCH_SIZE) || (j < 0) )
         {
             ERROR("Max batch size exceeded. Giving up.");
             goto out;